<?php

namespace app\rest\validate;

use think\Validate;

class User extends Validate
{
    // 验证规则
    protected $rule = [
        'name' => ['require', 'min' => 2, 'max' => 25],
        'sex' => ['in' => '0,1,2'],
        'age' => ['number','between'=>'1,120'],
        'tel' => ['require','regex'=>'/^1[^012]\d{9}$/']
    ];

    protected $message = [
        'age.between' => '年龄别太大,也别太小',
        'age.number' => '您老给我来个数字呗!!!'
    ];





}




